package com.blog.cloud.controller.rec.blog;

import com.blog.cloud.comm.modal.pojo.BlogContent;
import com.blog.cloud.comm.modal.pojo.User;
import com.blog.cloud.controller.base.BaseController;
import com.blog.cloud.service.rec.blog.BlogContentService;
import com.jfinal.aop.Before;
import com.jfinal.core.ActionKey;
import com.jfinal.ext.interceptor.NoUrlPara;

public class BlogController extends BaseController {
	
	
	
	private BlogContentService blogContentService = new BlogContentService();
	
	@Before(NoUrlPara.class)
	public void index(){
		System.out.println("-----------0000000000000000000-----------");
		String responeJspPrefix = super.getResponeJspPrefix("rec_blog_info.jsp");
		render(responeJspPrefix);
	}
	
	
	
	@ActionKey("blog/getblogcontentinfo")
	public void getBlogContentInfo(){
		
		String serialId = getPara("serialId");
		System.out.println("------------------------");
		User user = super.getSessionByUser();
		if(user!=null){
			BlogContent blogInfo = blogContentService.getBlogContentBySerialId(serialId);
			setAttr("blogInfo", blogInfo);
		}
		String responeJspPrefix = super.getResponeJspPrefix("rec_blog_info.jsp");
		render(responeJspPrefix);
	}
	
	
	
	
	
	
	
}
